import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor";
import _map from "lodash/map";
import _join from "lodash/join";
import _isUndefined from "lodash/isUndefined";
import _isEmpty from "lodash/isEmpty";
import _forEach from "lodash/forEach";
import _find from "lodash/find";
import _differenceWith from "lodash/differenceWith";
var _excluded = ["defaultRoleIdUpdate", "id", "startDateActive", "endDateActive"],
    _excluded2 = ["form", "editRecord", "isCreate", "fetchRoles", "queryDetailLoading"];

var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _class, _class2;

/**
 * EditModal.js
 * 当编辑自己的帐号时, 角色时不可以新增和删除的
 * @date 2018-12-16

 */
import React from 'react';
import { Checkbox, Col, DatePicker, Form, Input, Modal, Row, Select, Spin, Switch, Tooltip, Icon } from 'antd';
import { Bind } from 'lodash-decorators';
import moment from 'moment';
import Lov from 'components/Lov';
import EditTable from 'components/EditTable';
import { Button as ButtonPermission } from 'components/Permission';
import intl from 'utils/intl';
import { addItemsToPagination, createPagination, delItemsToPagination, getDateFormat, getEditTableData, tableScrollWidth } from 'utils/utils';
import { EMAIL, NOT_CHINA_PHONE, PHONE, CODE } from 'utils/regExp';
import { DEFAULT_DATE_FORMAT, EDIT_FORM_ITEM_LAYOUT_COL_3, FORM_COL_2_LAYOUT, MODAL_FORM_ITEM_LAYOUT } from 'utils/constants';
import { VERSION_IS_OP } from 'utils/config';
import { validatePasswordRule } from "../../../../utils/validator";
import styles from "../../index.less?modules";
import RoleModal from "./RoleModal";
var EditModal = (_dec = Form.create({
  fieldNameProp: null
}), _dec2 = Bind(), _dec3 = Bind(), _dec4 = Bind(), _dec5 = Bind(), _dec6 = Bind(), _dec7 = Bind(), _dec8 = Bind(), _dec9 = Bind(), _dec10 = Bind(), _dec11 = Bind(), _dec12 = Bind(), _dec13 = Bind(), _dec14 = Bind(), _dec15 = Bind(), _dec16 = Bind(), _dec(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
  _inherits(EditModal, _React$Component);

  var _super = _createSuper(EditModal);

  function EditModal() {
    var _this;

    _classCallCheck(this, EditModal);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));
    _this.state = {
      selectedRowKeys: [],
      roleModalProps: {},
      // 新建角色框
      // 角色表格的信息
      dataSource: [],
      pagination: false,
      roleTableFetchLoading: false // 角色加载数据 和 翻页改变

    };
    _this.rolePaginationCache = void 0;
    return _this;
  }

  _createClass(EditModal, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      var _this2 = this;

      var _this$props = this.props,
          _this$props$isCreate = _this$props.isCreate,
          isCreate = _this$props$isCreate === void 0 ? true : _this$props$isCreate,
          fetchDetailData = _this$props.fetchDetailData,
          detailRecord = _this$props.detailRecord;

      if (!isCreate) {
        fetchDetailData(detailRecord).then(function (editRecord) {
          _this2.fetchRolesFirst(editRecord);
        });
      }
    }
  }, {
    key: "changeCountryId",
    value: function changeCountryId() {
      var setFieldsValue = this.props.form.setFieldsValue;
      setFieldsValue({
        regionId: undefined
      });
    }
  }, {
    key: "fetchRolesFirst",
    value: function fetchRolesFirst() {
      var _this3 = this;

      var editRecord = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _this$props2 = this.props,
          fetchCurrentUserRoles = _this$props2.fetchCurrentUserRoles,
          _this$props2$isCreate = _this$props2.isCreate,
          isCreate = _this$props2$isCreate === void 0 ? true : _this$props2$isCreate,
          _this$props2$isAdmin = _this$props2.isAdmin,
          isAdmin = _this$props2$isAdmin === void 0 ? true : _this$props2$isAdmin;

      if (!isCreate) {
        this.showRoleTableLoading();
        fetchCurrentUserRoles({
          userId: editRecord.id
        }).then(function (roleContent) {
          // 在前面中已经 getResponse 了
          if (roleContent) {
            _this3.setState({
              dataSource: isAdmin ? roleContent.content.map(function (r) {
                return _objectSpread(_objectSpread({}, r), {}, {
                  _status: 'update',
                  _isRemote: true
                });
              }) : _map(roleContent.content, function (r) {
                return _objectSpread(_objectSpread({}, r), {}, {
                  _status: 'update',
                  _isRemote: true
                });
              }),
              pagination: createPagination(roleContent)
            }); // 翻页清空 已取消默认角色的租户

          }
        }).finally(function () {
          _this3.hiddenRoleTableLoading();
        });
      }
    }
    /**
     * 角色 table 分页改变
     * 如果是新增用户 分页是
     * @param {object} page
     * @param {object} filter
     * @param {object} sort
     */

  }, {
    key: "handleRoleTableChange",
    value: function handleRoleTableChange(page, filter, sort) {
      var _this4 = this;

      var _this$props3 = this.props,
          fetchCurrentUserRoles = _this$props3.fetchCurrentUserRoles,
          _this$props3$isCreate = _this$props3.isCreate,
          isCreate = _this$props3$isCreate === void 0 ? true : _this$props3$isCreate,
          _this$props3$editReco = _this$props3.editRecord,
          editRecord = _this$props3$editReco === void 0 ? {} : _this$props3$editReco;

      if (!isCreate) {
        this.showRoleTableLoading();
        fetchCurrentUserRoles({
          page: page,
          sort: sort,
          userId: editRecord.id
        }).then(function (roleContent) {
          // 在前面中已经 getResponse 了
          if (roleContent) {
            _this4.setState({
              dataSource: _map(roleContent.content, function (r) {
                return _objectSpread(_objectSpread({}, r), {}, {
                  _status: 'update',
                  _isRemote: true
                });
              }),
              pagination: createPagination(roleContent)
            }); // 翻页清空 已取消默认角色的租户

          }
        }).finally(function () {
          _this4.hiddenRoleTableLoading();
        });
      }
    }
  }, {
    key: "showRoleTableLoading",
    value: function showRoleTableLoading() {
      this.setState({
        roleTableFetchLoading: true
      });
    }
  }, {
    key: "hiddenRoleTableLoading",
    value: function hiddenRoleTableLoading() {
      this.setState({
        roleTableFetchLoading: false
      });
    } // @Bind()
    // isRoleCanUpdate(role = {}, account = {}) {
    //   if (role._status === 'create') {
    //     return true;
    //   }
    //   // 只检查了 层级 为 平台 和 租户的情况
    //   if (role.assignLevel === 'site' || role.assignLevel === 'organization') {
    //     if (role.assignLevelValue !== (account.organizationId || account.tenantId)) {
    //       return false;
    //     }
    //   }
    //   return true;
    // }

  }, {
    key: "getRoleColumns",
    value: function getRoleColumns() {
      var _this5 = this;

      var _this$props4 = this.props,
          editRecord = _this$props4.editRecord,
          isCreate = _this$props4.isCreate;
      return [{
        title: intl.get('ciam.subAccount.model.role.name').d('角色名称'),
        dataIndex: 'name'
      }, !VERSION_IS_OP && {
        title: intl.get('entity.tenant.name').d('租户名称'),
        dataIndex: 'tenantName',
        width: 250
      }, {
        title: intl.get('ciam.subAccount.model.role.startDateActive').d('起始时间'),
        key: 'startDateActive',
        width: 140,
        render: function render(_, record) {
          var $form = record.$form;
          var getFieldDecorator = $form.getFieldDecorator;
          var dateFormat = getDateFormat();
          return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('startDateActive', {
            initialValue: record.startDateActive ? moment(record.startDateActive, DEFAULT_DATE_FORMAT) : undefined
          })( /*#__PURE__*/React.createElement(DatePicker, {
            format: dateFormat,
            style: {
              width: '100%'
            },
            placeholder: null,
            disabled: record.manageableFlag === 0,
            disabledDate: function disabledDate(currentDate) {
              return $form.getFieldValue('endDateActive') && moment($form.getFieldValue('endDateActive')).isBefore(currentDate, 'day');
            }
          })));
        }
      }, {
        title: intl.get('ciam.subAccount.model.role.endDateActive').d('失效时间'),
        key: 'endDateActive',
        width: 140,
        render: function render(_, record) {
          var $form = record.$form;
          var getFieldDecorator = $form.getFieldDecorator;
          var dateFormat = getDateFormat();
          return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('endDateActive', {
            initialValue: record.endDateActive ? moment(record.endDateActive, DEFAULT_DATE_FORMAT) : undefined
          })( /*#__PURE__*/React.createElement(DatePicker, {
            format: dateFormat,
            style: {
              width: '100%'
            },
            disabled: record.manageableFlag === 0,
            placeholder: null,
            disabledDate: function disabledDate(currentDate) {
              return $form.getFieldValue('startDateActive') && moment($form.getFieldValue('startDateActive')).isAfter(currentDate, 'day');
            }
          })));
        }
      }, {
        title: intl.get('ciam.subAccount.model.role.defaultRoleId').d('默认'),
        key: 'defaultRoleId',
        width: 80,
        render: function render(_, record) {
          var defaultRole = record.defaultRole,
              assignLevel = record.assignLevel;

          if (assignLevel === 'organization' || assignLevel === 'org') {
            return /*#__PURE__*/React.createElement(Checkbox, {
              checked: defaultRole,
              disabled: isCreate ? false : editRecord.userType !== 'P',
              onClick: function onClick() {
                _this5.handleRoleDefaultChange(record);
              }
            });
          }

          return null;
        }
      }].filter(Boolean);
    }
  }, {
    key: "handleRowSelectChange",
    value: function handleRowSelectChange(_) {
      var selectedRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
      this.setState({
        selectedRowKeys: _map(selectedRows, function (r) {
          return r.id;
        }),
        selectedRows: selectedRows
      });
    }
  }, {
    key: "handleRoleDefaultChange",
    value: function handleRoleDefaultChange(record) {
      var _this$state$dataSourc = this.state.dataSource,
          dataSource = _this$state$dataSourc === void 0 ? [] : _this$state$dataSourc;
      var defaultChangeTo = !record.defaultRole;
      var newDataSource = dataSource.map(function (item) {
        if (item.id === record.id) {
          return _objectSpread(_objectSpread({}, item), {}, {
            defaultRole: defaultChangeTo,
            defaultRoleIdUpdate: true
          });
        } else if (defaultChangeTo && item.tenantId === record.tenantId) {
          // item 取消同租户的 defaultRole
          return _objectSpread(_objectSpread({}, item), {}, {
            defaultRole: false,
            defaultRoleIdUpdate: item.defaultRole
          });
        } else {
          return item;
        }
      });
      this.setState({
        dataSource: newDataSource
      });
    }
  }, {
    key: "handleRoleRemove",
    value: function handleRoleRemove() {
      var _this6 = this;

      Modal.confirm({
        title: intl.get("cpaas.common.message.confirm.title").d('提示'),
        content: intl.get("ciam.subAccount.view.message.title.content").d('确定删除吗？'),
        onOk: function onOk() {
          var _this6$state$selected = _this6.state.selectedRows,
              selectedRows = _this6$state$selected === void 0 ? [] : _this6$state$selected;
          var _this6$props = _this6.props,
              _this6$props$editReco = _this6$props.editRecord,
              editRecord = _this6$props$editReco === void 0 ? {} : _this6$props$editReco,
              onRoleRemove = _this6$props.onRoleRemove;
          var remoteRemoveDataSource = [];

          _forEach(selectedRows, function (r) {
            if (r._isRemote) {
              remoteRemoveDataSource.push({
                roleId: r.id,
                memberId: editRecord.id
              });
            }
          });

          if (remoteRemoveDataSource.length > 0) {
            onRoleRemove(remoteRemoveDataSource).then(function (res) {
              if (res) {
                _this6.removeLocaleRoles();
              }
            });
          } else {
            _this6.removeLocaleRoles();
          }
        }
      });
    }
  }, {
    key: "removeLocaleRoles",
    value: function removeLocaleRoles() {
      var nextState = {};
      var _this$state = this.state,
          _this$state$dataSourc2 = _this$state.dataSource,
          dataSource = _this$state$dataSourc2 === void 0 ? [] : _this$state$dataSourc2,
          _this$state$selectedR = _this$state.selectedRowKeys,
          selectedRowKeys = _this$state$selectedR === void 0 ? [] : _this$state$selectedR,
          _this$state$paginatio = _this$state.pagination,
          pagination = _this$state$paginatio === void 0 ? {} : _this$state$paginatio;
      var _this$props$isCreate2 = this.props.isCreate,
          isCreate = _this$props$isCreate2 === void 0 ? true : _this$props$isCreate2;
      nextState.dataSource = _differenceWith(dataSource, selectedRowKeys, function (r1, r2) {
        return r1.id === r2;
      });
      nextState.pagination = isCreate ? false : delItemsToPagination(selectedRowKeys.length, dataSource.length, pagination);
      nextState.selectedRowKeys = [];
      nextState.selectedRows = [];
      this.setState(nextState);
    }
  }, {
    key: "handleRoleCreate",
    value: function handleRoleCreate() {
      var _this$props5 = this.props,
          _this$props5$editReco = _this$props5.editRecord,
          editRecord = _this$props5$editReco === void 0 ? {} : _this$props5$editReco,
          _this$props5$isCreate = _this$props5.isCreate,
          isCreate = _this$props5$isCreate === void 0 ? true : _this$props5$isCreate;
      var _this$state$dataSourc3 = this.state.dataSource,
          dataSource = _this$state$dataSourc3 === void 0 ? [] : _this$state$dataSourc3;
      var excludeUserIds = []; // 当前编辑帐号的帐号id( 需要的排除帐号对应的角色 )

      var excludeRoleIds = [];

      if (!isCreate) {
        excludeUserIds.push(editRecord.id);
      }

      dataSource.forEach(function (role) {
        if (role._status === 'create') {
          excludeRoleIds.push(role.id);
        }
      });
      this.setState({
        roleModalProps: {
          visible: true,
          excludeUserIds: excludeUserIds,
          excludeRoleIds: excludeRoleIds
        }
      });
    }
  }, {
    key: "handleRoleCreateSave",
    value: function handleRoleCreateSave(roles) {
      if (roles && roles.length > 0) {
        var _this$state2 = this.state,
            _this$state2$dataSour = _this$state2.dataSource,
            dataSource = _this$state2$dataSour === void 0 ? [] : _this$state2$dataSour,
            _this$state2$paginati = _this$state2.pagination,
            pagination = _this$state2$paginati === void 0 ? {} : _this$state2$paginati;
        var _this$props$isCreate3 = this.props.isCreate,
            isCreate = _this$props$isCreate3 === void 0 ? true : _this$props$isCreate3;
        this.setState({
          dataSource: [].concat(_toConsumableArray(dataSource), _toConsumableArray(roles.map(function (role) {
            // 保存时的数据结构
            // assignLevel: "organization" // 层级
            // assignLevelValue: 180149 // 层级值
            // memberType: "user" // 恒定为 user
            // roleId: 150191 // 角色id
            // sourceId: 180149 // 当前用户所属租户
            // sourceType: "organization" // 当前租户层级
            // todo 角色层级值 的取值 到底需要怎么做
            // warn: 如果 角色 的 level 为 site 那么 这个角色的 租户 为 0租户
            var assignLevel = 'organization';
            var assignLevelValue = role.tenantId;
            var assignLevelValueMeaning = role.tenantName;
            return {
              level: role.level,
              // 需要将 role.level 传递下来, 下面的判断需要
              // 角色所属的租户
              tenantId: role.tenantId,
              // 角色所属的租户名称
              tenantName: role.tenantName,
              // 角色名称 展示使用
              name: role.name,
              // 用来限制 层级值
              parentRoleAssignLevel: role.parentRoleAssignLevel,
              // 角色id
              id: role.id,
              // sourceType 是 选中角色的 level
              sourceType: role.level,
              // memberType 是固定的 user
              memberType: 'user',
              // assignLevel 和 assignLevelValue 是需要自己填写的
              assignLevel: assignLevel,
              assignLevelValue: assignLevelValue,
              assignLevelValueMeaning: assignLevelValueMeaning,
              _status: 'create',
              // 新加进来的 角色 都是可以管理的
              manageableFlag: 1
            };
          }))),
          pagination: isCreate ? false : addItemsToPagination(roles.length, dataSource.length, pagination)
        });
      }

      this.handleRoleCreateCancel();
    }
  }, {
    key: "handleRoleCreateCancel",
    value: function handleRoleCreateCancel() {
      this.setState({
        roleModalProps: {
          visible: false
        }
      });
    }
  }, {
    key: "handleEditModalOk",
    value: function handleEditModalOk() {
      var _this7 = this;

      var _this$props6 = this.props,
          form = _this$props6.form,
          isCreate = _this$props6.isCreate;
      form.validateFields(function (err, fieldsValue) {
        if (!err) {
          var _this7$state$dataSour = _this7.state.dataSource,
              dataSource = _this7$state$dataSour === void 0 ? [] : _this7$state$dataSour;
          var memberRoleList = []; // defaultRoleIds 不使用了, 使用 [ { roleId, tenantId, defaultFlag } ]

          var defaultRoles = [];
          var validatingDataSource = dataSource.filter(function (r) {
            return r._status === 'create' || r._status === 'update';
          });
          var validateDataSource = getEditTableData(validatingDataSource);
          dataSource.forEach(function (oldR) {
            // // 如果 assignLevelValue 有值, 则使用他的值, 否则通过 层级 来确定层级值
            // const assignLevelValue = isUndefined(r.assignLevelValue)
            //   ? r.assignLevel === 'site' || r.assignLevel === 'organization'
            //     ? fieldsValue.organizationId
            //     : undefined
            //   : r.assignLevelValue;
            // 去掉前端添加的字段
            var r = _find(validateDataSource, function (or) {
              return or.id === oldR.id;
            });

            if (r) {
              // 是可以修改的数据
              var defaultRoleIdUpdate = r.defaultRoleIdUpdate,
                  id = r.id,
                  startDateActive = r.startDateActive,
                  endDateActive = r.endDateActive,
                  oriRecord = _objectWithoutProperties(r, _excluded);

              var newRole = _objectSpread(_objectSpread({}, oriRecord), {}, {
                // 需要得到之前角色的 id 等信息
                assignLevel: r.assignLevel,
                // 层级
                // 当 层级 为 组织 和 租户 时, 层级值为 租户id
                assignLevelValue: r.assignLevelValue,
                // 层级值
                memberType: 'user',
                // 恒定为 user
                roleId: id,
                // 角色id
                sourceId: fieldsValue.organizationId,
                // 当前用户所属租户
                sourceType: r.sourceType,
                // 当前租户层级
                startDateActive: startDateActive && startDateActive.format(DEFAULT_DATE_FORMAT),
                endDateActive: endDateActive && endDateActive.format(DEFAULT_DATE_FORMAT)
              });

              if (defaultRoleIdUpdate) {
                defaultRoles.push({
                  roleId: newRole.roleId,
                  tenantId: newRole.tenantId,
                  defaultFlag: newRole.defaultRole === false ? 0 : 1
                });
              }

              if ( // 数据校验
              !_isUndefined(newRole.assignLevel) && !_isUndefined(newRole.assignLevelValue) && ( // 重复校验
              oldR._status === 'create' || oldR._status === 'update' && (oldR.assignLevel !== newRole.assignLevel || oldR.assignLevelValue !== newRole.assignLevelValue) || oldR._status === 'update' && oldR.startDateActive !== newRole.startDateActive || oldR.endDateActive !== newRole.endDateActive) // 如果是正常流程 这两个是一定相同的
              // || oldR.sourceId !== newRole.sourceId
              // || oldR.sourceType !== newRole.sourceType
              ) {
                memberRoleList.push(newRole);
              }
            } else {
              if (oldR.defaultRoleIdUpdate && oldR.defaultRole === false) {
                // 该角色是 租户/组织 层 默认角色更新过 且 取消了
                defaultRoles.push({
                  roleId: oldR.id,
                  tenantId: oldR.tenantId,
                  defaultFlag: 0
                });
              }

              if (oldR.defaultRoleIdUpdate && oldR.defaultRole !== false) {
                defaultRoles.push({
                  roleId: oldR.id,
                  tenantId: oldR.tenantId,
                  defaultFlag: 1
                });
              }
            }
          });

          if (dataSource.length !== 0 && validatingDataSource.length !== validateDataSource.length) {
            // 必须要有角色, 且校验通过
            return;
          }

          var _this7$props = _this7.props,
              _this7$props$editReco = _this7$props.editRecord,
              editRecord = _this7$props$editReco === void 0 ? {} : _this7$props$editReco,
              onOk = _this7$props.onOk;

          var saveData = _objectSpread(_objectSpread(_objectSpread({}, editRecord), fieldsValue), {}, {
            startDateActive: fieldsValue.startDateActive.format(DEFAULT_DATE_FORMAT),
            endDateActive: fieldsValue.endDateActive ? fieldsValue.endDateActive.format(DEFAULT_DATE_FORMAT) : undefined,
            birthday: fieldsValue.birthday ? fieldsValue.birthday.format(DEFAULT_DATE_FORMAT) : undefined,
            defaultRoles: defaultRoles,
            memberRoleList: memberRoleList
          });

          var newSaveData = isCreate ? _objectSpread({
            userType: 'P'
          }, saveData) : saveData;
          onOk(newSaveData);
        }
      });
    }
    /**
     * @date 2019-06-13
     * 区号改变 需要 重置手机号的校验状态
     */

  }, {
    key: "reValidationPhone",
    value: function reValidationPhone(value) {
      var form = this.props.form;
      var prevInternationalTelCode = form.getFieldValue('internationalTelCode');

      if (value === '+86' || prevInternationalTelCode === '+86') {
        // 只要 +86 出现在 中间态 就需要重新手动校验 phone
        var curPhone = form.getFieldValue('phone');
        var errors = null;

        if (curPhone) {
          var testReg = value === '+86' ? PHONE : NOT_CHINA_PHONE;

          if (!testReg.test(curPhone)) {
            errors = [new Error(intl.get('cpaas.common.validation.phone').d('手机格式不正确'))];
          }
        } else {
          errors = [new Error(intl.get('cpaas.common.validation.notNull', {
            name: intl.get('ciam.subAccount.model.user.phone').d('手机号码')
          }))];
        }

        form.setFields({
          phone: {
            value: curPhone,
            errors: errors
          }
        });
      }
    } // #region 验证密码修改后 是否和 确认密码一致

    /**
     * 检查 确认密码是否与密码一致
     */

  }, {
    key: "validatePasswordRepeatForPassword",
    value: function validatePasswordRepeatForPassword(e) {
      var form = this.props.form;
      var anotherPassword = form.getFieldValue('anotherPassword');
      var anotherPasswordField = {
        value: anotherPassword
      };

      if (e.target.value) {
        if (e.target.value === anotherPassword) {
          anotherPasswordField.errors = null;
        } else {
          anotherPasswordField.errors = [new Error(intl.get('ciam.subAccount.view.validation.passwordSame').d('确认密码必须与密码一致'))];
        }
      } else {
        anotherPasswordField.errors = null;
      }

      form.setFields({
        anotherPassword: anotherPasswordField
      });
    }
  }, {
    key: "tenantChange",
    value: function tenantChange(value, record) {
      var getPasswordRule = this.props.getPasswordRule;
      getPasswordRule(record.tenantId);
    }
  }, {
    key: "renderForm",
    value: function renderForm() {
      var _this$props7 = this.props,
          path = _this$props7.path,
          form = _this$props7.form,
          _this$props7$editReco = _this$props7.editRecord,
          editRecord = _this$props7$editReco === void 0 ? {} : _this$props7$editReco,
          _this$props7$isCreate = _this$props7.isCreate,
          isCreate = _this$props7$isCreate === void 0 ? true : _this$props7$isCreate,
          _this$props7$isAdmin = _this$props7.isAdmin,
          isAdmin = _this$props7$isAdmin === void 0 ? true : _this$props7$isAdmin,
          roleRemoveLoading = _this$props7.roleRemoveLoading,
          _this$props7$idd = _this$props7.idd,
          idd = _this$props7$idd === void 0 ? [] : _this$props7$idd,
          _this$props7$gender = _this$props7.gender,
          gender = _this$props7$gender === void 0 ? [] : _this$props7$gender,
          _this$props7$currentU = _this$props7.currentUser.currentRoleCode,
          currentRoleCode = _this$props7$currentU === void 0 ? '' : _this$props7$currentU,
          _this$props7$password = _this$props7.passwordTipMsg,
          passwordTipMsg = _this$props7$password === void 0 ? {} : _this$props7$password;
      var _this$state3 = this.state,
          _this$state3$selected = _this$state3.selectedRowKeys,
          selectedRowKeys = _this$state3$selected === void 0 ? [] : _this$state3$selected,
          _this$state3$dataSour = _this$state3.dataSource,
          dataSource = _this$state3$dataSour === void 0 ? [] : _this$state3$dataSour,
          _this$state3$paginati = _this$state3.pagination,
          pagination = _this$state3$paginati === void 0 ? false : _this$state3$paginati,
          roleTableFetchLoading = _this$state3.roleTableFetchLoading;
      var rowSelection = {
        selectedRowKeys: selectedRowKeys,
        onChange: this.handleRowSelectChange,
        getCheckboxProps: function getCheckboxProps(record) {
          return {
            disabled: isAdmin && record._isRemote || record.manageableFlag === 0
          };
        }
      };
      var isSiteFlag = currentRoleCode === 'role/site/default/administrator';
      var emailError = form.getFieldError('email');
      var sameEmail = editRecord.email === form.getFieldValue('email');
      var phoneError = form.getFieldError('phone');
      var samePhone = editRecord.phone === form.getFieldValue('phone');
      var dateFormat = getDateFormat();
      var roleColumns = this.getRoleColumns(isSiteFlag); // eslint-disable-next-line no-nested-ternary

      var roleNode = isSiteFlag ? /*#__PURE__*/React.createElement(React.Fragment, {
        key: "role-no-same-user-btn"
      }, /*#__PURE__*/React.createElement(Row, {
        style: {
          textAlign: 'right',
          marginBottom: 16
        }
      }, /*#__PURE__*/React.createElement(Col, {
        span: 23
      }, /*#__PURE__*/React.createElement(ButtonPermission, {
        permissionList: [{
          code: "".concat(path, ".button.deleteUser"),
          type: 'button',
          meaning: '子账户管理-删除用户'
        }],
        style: editRecord.userType === 'P' || isCreate ? {
          marginRight: 8
        } : {
          display: 'none'
        },
        onClick: this.handleRoleRemove,
        disabled: selectedRowKeys.length === 0,
        loading: roleRemoveLoading
      }, intl.get('cpaas.common.button.delete').d('删除')), /*#__PURE__*/React.createElement(ButtonPermission, {
        style: editRecord.userType !== 'P' && !isCreate ? {
          display: 'none'
        } : {
          display: 'inline'
        },
        permissionList: [{
          code: "".concat(path, ".button.createUser"),
          type: 'button',
          meaning: '子账户管理-新建用户'
        }],
        type: "primary",
        onClick: this.handleRoleCreate
      }, intl.get('cpaas.common.button.create').d('新建'))), /*#__PURE__*/React.createElement(Col, {
        span: 1
      })), /*#__PURE__*/React.createElement(Row, {
        type: "flex"
      }, /*#__PURE__*/React.createElement(Col, {
        span: 3
      }), /*#__PURE__*/React.createElement(Col, {
        span: 20,
        className: styles['rule-table']
      }, /*#__PURE__*/React.createElement(EditTable, {
        bordered: true,
        rowKey: "id",
        dataSource: dataSource,
        pagination: pagination,
        loading: roleTableFetchLoading,
        columns: roleColumns,
        scroll: {
          x: tableScrollWidth(roleColumns)
        },
        onChange: this.handleRoleTableChange,
        rowSelection: rowSelection
      })))) : isAdmin ? /*#__PURE__*/React.createElement(Col, {
        key: "role-same-user"
      }, /*#__PURE__*/React.createElement(Form.Item, Object.assign({
        label: intl.get('ciam.subAccount.view.message.title.role').d('角色')
      }, EDIT_FORM_ITEM_LAYOUT_COL_3), /*#__PURE__*/React.createElement(EditTable, {
        bordered: true,
        pagination: false,
        rowKey: "id",
        columns: roleColumns,
        scroll: {
          x: tableScrollWidth(roleColumns)
        },
        rowSelection: rowSelection,
        dataSource: dataSource
      }))) : /*#__PURE__*/React.createElement(React.Fragment, {
        key: "role-no-same-user-btn"
      }, /*#__PURE__*/React.createElement(Row, {
        style: {
          textAlign: 'right',
          marginBottom: 16
        }
      }, /*#__PURE__*/React.createElement(Col, {
        span: 23
      }, /*#__PURE__*/React.createElement(ButtonPermission, {
        permissionList: [{
          code: "".concat(path, ".button.deleteDiffUser"),
          type: 'button',
          meaning: '子账户管理-删除用户'
        }],
        style: editRecord.userType === 'P' || isCreate ? {
          marginRight: 8
        } : {
          display: 'none'
        },
        onClick: this.handleRoleRemove,
        disabled: selectedRowKeys.length === 0
      }, intl.get('cpaas.common.button.delete').d('删除')), /*#__PURE__*/React.createElement(ButtonPermission, {
        permissionList: [{
          code: "".concat(path, ".button.createDiffUser"),
          type: 'button',
          meaning: '子账户管理-新建用户'
        }],
        type: "primary",
        onClick: this.handleRoleCreate,
        style: editRecord.userType !== 'P' && !isCreate ? {
          display: 'none'
        } : {
          display: 'inline'
        }
      }, intl.get('cpaas.common.button.create').d('新建'))), /*#__PURE__*/React.createElement(Col, {
        span: 1
      })), /*#__PURE__*/React.createElement(Row, {
        type: "flex"
      }, /*#__PURE__*/React.createElement(Col, {
        span: 3
      }), /*#__PURE__*/React.createElement(Col, {
        span: 20,
        className: styles['rule-table']
      }, /*#__PURE__*/React.createElement(EditTable, {
        bordered: true,
        rowKey: "id",
        dataSource: dataSource,
        pagination: pagination,
        loading: roleTableFetchLoading,
        columns: roleColumns,
        scroll: {
          x: tableScrollWidth(roleColumns)
        },
        onChange: this.handleRoleTableChange,
        rowSelection: isAdmin ? null : rowSelection
      }))));
      return /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(Row, {
        type: "flex"
      }, /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "loginName"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: /*#__PURE__*/React.createElement("span", null, intl.get('ciam.subAccount.model.user.loginName').d('账号'), "\xA0", /*#__PURE__*/React.createElement(Tooltip, {
          title: intl.get('ciam.subAccount.view.message.loginName.tooltip').d('不输入账户则自动生成')
        }, /*#__PURE__*/React.createElement(Icon, {
          type: "question-circle-o"
        })))
      }), form.getFieldDecorator('loginName', {
        initialValue: editRecord.loginName,
        rules: [{
          max: 30,
          message: intl.get('cpaas.common.validation.max', {
            max: 30
          })
        }, isCreate && {
          pattern: CODE,
          message: intl.get('cpaas.common.validation.code').d('大小写及数字，必须以字母、数字开头，可包含“-”、“_”、“.”、“/”')
        }].filter(Boolean)
      })( /*#__PURE__*/React.createElement(Input, {
        disabled: !isCreate
      })))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "realName"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.realName').d('名称')
      }), form.getFieldDecorator('realName', {
        initialValue: editRecord.realName,
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('ciam.subAccount.model.user.realName').d('名称')
          })
        }, {
          max: 40,
          message: intl.get('cpaas.common.validation.max', {
            max: 40
          })
        }]
      })( /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "birthday"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        key: "birthday",
        label: intl.get('ciam.subAccount.model.user.birthday').d('出生日期')
      }), form.getFieldDecorator('birthday', {
        initialValue: editRecord.birthday ? moment(editRecord.birthday, DEFAULT_DATE_FORMAT) : undefined
      })( /*#__PURE__*/React.createElement(DatePicker, {
        format: dateFormat,
        style: {
          width: '100%'
        },
        placeholder: ""
      })))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "nickname"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.nickname').d('昵称')
      }), form.getFieldDecorator('nickname', {
        initialValue: editRecord.nickname,
        rules: [{
          max: 10,
          message: intl.get('cpaas.common.validation.max', {
            max: 10
          })
        }]
      })( /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "gender"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('cpaas.common.gender').d('性别')
      }), form.getFieldDecorator('gender', {
        initialValue: _isUndefined(editRecord.gender) ? '' : "".concat(editRecord.gender)
      })( /*#__PURE__*/React.createElement(Select, {
        allowClear: true
      }, _map(gender, function (item) {
        return /*#__PURE__*/React.createElement(Select.Option, {
          value: item.value,
          key: item.value
        }, item.meaning);
      }))))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "country"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.countryId').d('国家')
      }), form.getFieldDecorator('countryId', {
        initialValue: editRecord.countryId
      })( /*#__PURE__*/React.createElement(Lov, {
        code: "CPFM.COUNTRY",
        onChange: this.changeCountryId,
        textValue: editRecord.countryName,
        queryParams: {
          enabledFlag: 1
        } // textField="tenantName"
        // disabled={!isCreate}

      })))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "regionId"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.regionId').d('地区')
      }), form.getFieldDecorator('regionId', {
        initialValue: editRecord.regionId
      })( /*#__PURE__*/React.createElement(Lov, {
        code: "CPFM.REGION",
        queryParams: {
          countryId: form.getFieldValue('countryId')
        },
        textValue: editRecord.regionName // textField="tenantName"
        // disabled={!isCreate}

      })))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "addressDetail"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.addressDetail').d('详细地址')
      }), form.getFieldDecorator('addressDetail', {
        initialValue: editRecord.addressDetail,
        rules: [{
          max: 50,
          message: intl.get('cpaas.common.validation.max', {
            max: 50
          })
        }]
      })( /*#__PURE__*/React.createElement(Input, null)))), isCreate && /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "tenant"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.tenant').d('所属租户')
      }), form.getFieldDecorator('organizationId', {
        initialValue: editRecord.organizationId,
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('ciam.subAccount.model.user.tenant').d('所属租户')
          })
        }]
      })( /*#__PURE__*/React.createElement(Lov, {
        code: "CPFM.TENANT",
        textValue: editRecord.tenantName,
        textField: "tenantName",
        disabled: !isCreate,
        onChange: this.tenantChange
      })))), /*#__PURE__*/React.createElement(Col, Object.assign({}, FORM_COL_2_LAYOUT, {
        key: "email"
      }), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.email').d('邮箱')
      }, isCreate ? {} : {
        hasFeedback: true,
        // eslint-disable-next-line no-nested-ternary
        help: emailError ? _join(emailError) : sameEmail && editRecord.email && editRecord.emailCheckFlag || !form.getFieldValue('email') ? '' : intl.get('ciam.subAccount.view.validation.emailNotCheck').d('邮箱未验证'),
        // eslint-disable-next-line no-nested-ternary
        validateStatus: emailError ? 'error' : // eslint-disable-next-line no-nested-ternary
        sameEmail && editRecord.email && editRecord.emailCheckFlag ? 'success' : form.getFieldValue('email') ? 'warning' : undefined
      }), form.getFieldDecorator('email', {
        initialValue: editRecord.email,
        rules: [{
          pattern: EMAIL,
          message: intl.get('cpaas.common.validation.email').d('邮箱格式不正确')
        }, {
          max: 128,
          message: intl.get('cpaas.common.validation.max', {
            max: 128
          })
        }]
      })( /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "phone"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.phone').d('手机号码')
      }, isCreate ? {} : {
        hasFeedback: true,
        // eslint-disable-next-line no-nested-ternary
        help: phoneError ? _join(phoneError) : editRecord.phoneCheckFlag ? '' : intl.get('ciam.subAccount.view.validation.phoneNotCheck').d('手机号码未验证'),
        // eslint-disable-next-line no-nested-ternary
        validateStatus: phoneError ? 'error' : samePhone && editRecord.phoneCheckFlag ? 'success' : 'warning'
      }), form.getFieldDecorator('phone', {
        initialValue: editRecord.phone,
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('ciam.subAccount.model.user.phone').d('手机号码')
          })
        }, {
          pattern: form.getFieldValue('internationalTelCode') === '+86' ? PHONE : NOT_CHINA_PHONE,
          message: intl.get('cpaas.common.validation.phone').d('手机格式不正确')
        }]
      })( /*#__PURE__*/React.createElement(Input, {
        addonBefore: form.getFieldDecorator('internationalTelCode', {
          initialValue: editRecord.internationalTelCode || idd[0] && idd[0].value || '+86'
        })( /*#__PURE__*/React.createElement(Select, {
          onChange: this.reValidationPhone
        }, _map(idd, function (r) {
          return /*#__PURE__*/React.createElement(Select.Option, {
            key: r.value,
            value: r.value
          }, r.meaning);
        })))
      })))), isCreate && /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "password"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: /*#__PURE__*/React.createElement("span", null, intl.get('ciam.subAccount.model.user.password').d('密码'), "\xA0", /*#__PURE__*/React.createElement(Tooltip, {
          title: intl.get('ciam.subAccount.view.message.password.tooltip').d('不输入密码则使用默认密码')
        }, /*#__PURE__*/React.createElement(Icon, {
          type: "question-circle-o"
        })))
      }), form.getFieldDecorator('password', {
        rules: [{
          validator: function validator(_, value, callback) {
            validatePasswordRule(value, callback, _objectSpread(_objectSpread({}, passwordTipMsg), {}, {
              loginName: form.getFieldValue('loginName')
            }));
          }
        }, {
          max: 110,
          message: intl.get('cpaas.common.validation.max', {
            max: 110
          })
        }]
      })( /*#__PURE__*/React.createElement(Input, {
        type: "password",
        autocomplete: "new-password",
        onChange: this.validatePasswordRepeatForPassword
      })))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "startDateActive"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('cpaas.common.date.active.from').d('有效日期从')
      }), form.getFieldDecorator('startDateActive', {
        initialValue: editRecord.startDateActive ? moment(editRecord.startDateActive, DEFAULT_DATE_FORMAT) : undefined,
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('cpaas.common.date.active.from').d('有效日期从')
          })
        }]
      })( /*#__PURE__*/React.createElement(DatePicker, {
        format: dateFormat,
        style: {
          width: '100%'
        },
        placeholder: null,
        disabledDate: function disabledDate(currentDate) {
          return form.getFieldValue('endDateActive') && moment(form.getFieldValue('endDateActive')).isBefore(currentDate, 'day');
        }
      })))), /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "endDateActive"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        key: "endDateActive",
        label: intl.get('cpaas.common.date.active.to').d('有效日期至')
      }), form.getFieldDecorator('endDateActive', {
        initialValue: editRecord.endDateActive ? moment(editRecord.endDateActive, DEFAULT_DATE_FORMAT) : undefined
      })( /*#__PURE__*/React.createElement(DatePicker, {
        format: dateFormat,
        style: {
          width: '100%'
        },
        placeholder: "",
        disabledDate: function disabledDate(currentDate) {
          return form.getFieldValue('startDateActive') && moment(form.getFieldValue('startDateActive')).isAfter(currentDate, 'day');
        }
      })))), isCreate || /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "tenant"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.tenant').d('所属租户')
      }), form.getFieldDecorator('organizationId', {
        initialValue: editRecord.organizationId,
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('ciam.subAccount.model.user.tenant').d('所属租户')
          })
        }]
      })( /*#__PURE__*/React.createElement(Lov, {
        code: "CPFM.TENANT",
        textValue: editRecord.tenantName,
        disabled: !isCreate
      })))), isCreate || /*#__PURE__*/React.createElement(Col, Object.assign({
        key: "enabled"
      }, FORM_COL_2_LAYOUT), /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, MODAL_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.subAccount.model.user.enabled').d('冻结')
      }), form.getFieldDecorator('enabled', {
        initialValue: _isUndefined(editRecord.enabled) ? true : editRecord.enabled
      })( /*#__PURE__*/React.createElement(Switch, {
        checkedValue: false,
        unCheckedValue: true
      }))))), /*#__PURE__*/React.createElement(Row, null, roleNode));
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props8 = this.props,
          form = _this$props8.form,
          editRecord = _this$props8.editRecord,
          isCreate = _this$props8.isCreate,
          fetchRoles = _this$props8.fetchRoles,
          _this$props8$queryDet = _this$props8.queryDetailLoading,
          queryDetailLoading = _this$props8$queryDet === void 0 ? false : _this$props8$queryDet,
          modalProps = _objectWithoutProperties(_this$props8, _excluded2); // todo 租户id 明天问下 明伟哥。


      var tenantId = 0;
      var _this$state$roleModal = this.state.roleModalProps,
          roleModalProps = _this$state$roleModal === void 0 ? {} : _this$state$roleModal;
      return /*#__PURE__*/React.createElement(Modal, Object.assign({
        title: isCreate ? intl.get('ciam.subAccount.view.message.title.userCreate').d('账号新建') : intl.get('ciam.subAccount.view.message.title.userEdit').d('账号编辑'),
        wrapClassName: "ant-modal-sidebar-right",
        transitionName: "move-right",
        width: 1000
      }, modalProps, {
        onOk: this.handleEditModalOk
      }), /*#__PURE__*/React.createElement(Spin, {
        spinning: queryDetailLoading
      }, this.renderForm(), roleModalProps.visible && /*#__PURE__*/React.createElement(RoleModal, Object.assign({}, roleModalProps, {
        fetchRoles: fetchRoles,
        onSave: this.handleRoleCreateSave,
        onCancel: this.handleRoleCreateCancel,
        tenantId: tenantId
      }))));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      var _nextProps$isCreate = nextProps.isCreate,
          isCreate = _nextProps$isCreate === void 0 ? true : _nextProps$isCreate;
      var nextState = {};

      if (isCreate && prevState.pagination !== false) {
        nextState.pagination = false;
      }

      if (_isEmpty(nextState)) {
        return null;
      }

      return nextState;
    }
  }]);

  return EditModal;
}(React.Component), (_applyDecoratedDescriptor(_class2.prototype, "changeCountryId", [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, "changeCountryId"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleRoleTableChange", [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, "handleRoleTableChange"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "showRoleTableLoading", [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, "showRoleTableLoading"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "hiddenRoleTableLoading", [_dec5], Object.getOwnPropertyDescriptor(_class2.prototype, "hiddenRoleTableLoading"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleRowSelectChange", [_dec6], Object.getOwnPropertyDescriptor(_class2.prototype, "handleRowSelectChange"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleRoleDefaultChange", [_dec7], Object.getOwnPropertyDescriptor(_class2.prototype, "handleRoleDefaultChange"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleRoleRemove", [_dec8], Object.getOwnPropertyDescriptor(_class2.prototype, "handleRoleRemove"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "removeLocaleRoles", [_dec9], Object.getOwnPropertyDescriptor(_class2.prototype, "removeLocaleRoles"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleRoleCreate", [_dec10], Object.getOwnPropertyDescriptor(_class2.prototype, "handleRoleCreate"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleRoleCreateSave", [_dec11], Object.getOwnPropertyDescriptor(_class2.prototype, "handleRoleCreateSave"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleRoleCreateCancel", [_dec12], Object.getOwnPropertyDescriptor(_class2.prototype, "handleRoleCreateCancel"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleEditModalOk", [_dec13], Object.getOwnPropertyDescriptor(_class2.prototype, "handleEditModalOk"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "reValidationPhone", [_dec14], Object.getOwnPropertyDescriptor(_class2.prototype, "reValidationPhone"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "validatePasswordRepeatForPassword", [_dec15], Object.getOwnPropertyDescriptor(_class2.prototype, "validatePasswordRepeatForPassword"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "tenantChange", [_dec16], Object.getOwnPropertyDescriptor(_class2.prototype, "tenantChange"), _class2.prototype)), _class2)) || _class);
export { EditModal as default };